FROM pytorch/pytorch:2.6.0-cuda11.8-cudnn9-runtime

COPY img /opt/ocr/ocr
COPY main.py /opt/ocr/main.py

RUN apt update && \
    apt install -y libglib2.0-0 libgl1-mesa-glx libgomp1 && \
    apt clean && \
    apt autoclean && \
    apt autoremove
RUN pip install paddlepaddle-gpu==3.0.0rc1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ && \
    pip install paddleocr pymupdf uvicorn fastapi python-multipart && \
    rm -rf /root/.cache

WORKDIR /opt/ocr
ENTRYPOINT ["python", "main.py"]
